/** 顶部菜单样式 */
.konva-root-topmenu {
    width: 100%;
    height: @TopHeight;
    border-bottom: solid var(--konva-border-color, @konva-border-color) 1px;
    padding: 4px;
    display: flex;
    align-items: center;
    background-color: var(--konva-menu-background-color,
            @konva-menu-background-color );

    // 其他普通菜单，请使用 span 元素
    span {
        margin: 0 4px;
        height: 80%;
        padding: 2px 8px;
        display: flex;
        align-items: center;
        color: var(--text-color);
        transition: all 0.2s;
        user-select: none;
        font-size: 14px;
        border-radius: @BorderRadius;
        cursor: pointer;

        &:hover {
            background-color: var(--konva-menu-hover-bgcolor,
                    @konva-menu-hover-bgcolor );
        }
    }

    // 文件名 contentediable
    &-filename {
        height: 80%;
        display: flex;
        align-items: center;
        border: solid 1px transparent;
        width: 150px;
        padding: 0 4px;
        text-wrap: nowrap;
        overflow: hidden;

        &:focus-visible {
            outline: none;
        }

        &:focus {
            border: 1px solid var(--main-color);
            border-radius: @BorderRadius;
        }
    }

    // 新建幻灯片
    .add-slide {
        height: 80%;
        display: flex;
        align-items: center;

        span {
            height: 100%;
            margin: 0;
        }
    }

    // 中间的 插入、设计、切换、动画、预览、视图
    &-middle,
    &-right {
        display: flex;
        align-items: center;
        z-index: 10; // 这里的 zIndex 非常重要！！！是实现点击外部关闭二级菜单的关键，mask zIndex = 9
        user-select: none;
        height: 100%;
        margin: auto;

        span {
            margin: 0 6px;
            position: relative;
        }

        .unread {
            display: none;
            background-color: var(--konva-main-color, @konva-main-color);
            border-radius: 10px;
            padding: 0 6px;
            color: #fff;
            font-size: 12px;
            transform: translateY(-50%);
        }
    }

    /** 二级菜单样式公共样式 */
    .submenu {
        animation: enter-animation 0.3s ease-in-out;
        width: auto;
        background-color: var(--konva-menu-background-color,
                @konva-menu-background-color );
        box-shadow: 0 0 10px var(--konva-box-shadow-color, @konva-box-shadow-color);
        position: absolute;
        left: 50%;
        top: 48px;
        transform: translateX(-50%);
        border-radius: @BorderRadius;
        padding: 10px;

        .line-h {
            width: 100%;
            height: 0;
            margin: 4px 0;
            border-bottom: solid 1px var(--konva-border-color, @konva-border-color);
        }
    }

    // 分割线
    .line {
        margin: 0 4px;
        width: 0;
        height: 100%;
        border-right: solid var(--konva-border-color, @konva-border-color) 1px;

        &:hover {
            background-color: transparent;
        }
    }
}

/** 文件菜单样式 */
.konva-root-topmenu .submenu-filemenu {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: 5px 0;
    border-radius: @BorderRadius;
    transition: all 0.2s;

    &:hover {
        background-color: var(--konva-menu-hover-bgcolor,
                @konva-menu-hover-bgcolor );

        .tmenu {
            display: block !important;
        }
    }

    &-text {
        display: flex;
        align-items: center;

        i {
            font-size: 18px;
            margin-right: 8px;
        }
    }

    &-shortcut {
        font-size: 12px;
        color: var(--konva-text-info-color, @konva-text-info-color);
    }

    // 三级目录
    .tmenu {
        width: 120px;
        display: none;
        background-color: var(--konva-menu-background-color,
                @konva-menu-background-color );
        box-shadow: 0 0 10px var(--konva-box-shadow-color, @konva-box-shadow-color);
        border-radius: @BorderRadius;
        padding: 10px;
        position: absolute;
        left: 100%;
        top: 0;
    }
}

/** 插入菜单样式 */
.konva-root-topmenu .submenu-insertmenu {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 5px 0;
    transition: all 0.2s;

    &>* {
        &:hover {
            background-color: var(--konva-menu-hover-bgcolor,
                    @konva-menu-hover-bgcolor );
        }
    }

    &-text {
        display: flex;
        align-items: center;
        flex: auto;
        padding: 10px;

        svg {
            margin-right: 10px;
            width: 18px;
            height: 18px;
        }
    }

    &-shortcut {
        padding: 10px;
        border-left: solid var(--konva-border-color, @konva-border-color) 1px;
        font-size: 12px;
        color: var(--konva-text-info-color, @konva-text-info-color);
        position: relative;

        &:hover .submenu-insertmenu-shortcut-subs {
            display: flex;
        }

        &-subs {
            width: 180px;
            display: none;
            flex-wrap: wrap;
            border-radius: @BorderRadius;
            background-color: #fff;
            box-shadow: 0 0 10px var(--konva-box-shadow-color, @konva-box-shadow-color);
            padding: 10px;
            position: absolute;
            right: 0;
            top: 50%;
            transform: translate(100%, -50%);

            .spacial-svg:hover path {
                fill: var(--konva-main-color, @konva-main-color);
            }

            .icon-fill {
                &:hover {
                    path {
                        fill: var(--konva-main-color, @konva-main-color);
                    }
                }
            }

            svg {
                margin: 10px;
                cursor: pointer;
                width: 18px;
                height: 18px;

                &:hover {
                    path {
                        stroke: var(--konva-main-color, @konva-main-color);
                    }
                }
            }
        }
    }

    // 三级目录
    .tmenu {
        width: 120px;
        display: none;
        background-color: var(--konva-menu-background-color,
                @konva-menu-background-color );
        box-shadow: 0 0 10px var(--konva-box-shadow-color, @konva-box-shadow-color);
        border-radius: @BorderRadius;
        padding: 10px;
        position: absolute;
        left: 100%;
        top: 0;
    }
}

/** 切换菜单样式 */
.konva-root-topmenu .submenu-swith {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 40px;
    position: relative;

    .active {
        border: var(--konva-main-color, @konva-main-color) solid 2px;
    }

    &-item {
        width: calc(100% / 4);
        height: 110px;
        padding: 10px;
        border: solid var(--konva-border-color, @konva-border-color) 1px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;

        &-box {
            border-radius: @BorderRadius;
            overflow: hidden;
            width: 80px;
            height: 60px;
            background-color: var(--konva-main-color-2, @konva-main-color-1);
            transition: all 0.2s;

            &:hover::after {
                background-color: var(--konva-main-color, @konva-main-color);
                content: "UniPPT";
                color: #fff;
                height: 100%;
                width: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }

        &-text {
            font-size: 14px;
        }
    }

    &-apply {
        position: absolute;
        display: flex;
        bottom: 0;
        right: 0;

        span {
            margin: 0;
            height: 32px;
            display: flex;
            padding: 0 20px;
            border-radius: @BorderRadius;
            border: solid var(--konva-border-color, @konva-border-color) 1px;
            margin-left: 10px;
            background-color: var(--konva-main-color, @konva-main-color);
            color: #fff;
        }
    }
}